import { createRouter, createWebHashHistory } from 'vue-router';

const routes = [
  // {
  //   path: '/',
  //   component: () => import('./page/index.vue'),
  //   name: 'index'
  // },
  // {
  //   path: '/ai',
  //   component: () => import('./page/ai.vue'),
  //   name: 'ai',
  // },
  {
    path: '/video',
    component: () => import('./page/video.vue'),
    name: 'video',
    meta: {
      keep: true
    }
  },
  {
    path: '/video/heji',
    component: () => import('./page/video.heji.vue'),
    name: 'video.heji',
    meta: {
      keep: true
    }
  },
  {
    path: '/tiku',
    component: () => import('./page/tiku.vue'),
    name: 'tiku',
    meta: {
      keep: true
    }
  },
  {
    path: '/',
    component: () => import('./page/english/index.vue'),
    name: 'eng.',
    children: [
      {
        path: '/eng/english',
        component: () => import('./page/english/english.vue'),
        name: 'eng.english',
        meta: {
          keep: true
        }
      },
      {
        path: '/eng/history',
        component: () => import('./page/english/history.vue'),
        name: 'eng.history',
        meta: {
          keep: true
        }
      },
      {
        path: '/eng/danchi',
        component: () => import('./page/english/danchi.vue'),
        name: 'eng.danchi',
        meta: {
          keep: true
        }
      },
      {
        path: '/eng/dictation',
        component: () => import('./page/english/dictation.vue'),
        name: 'eng.dictation',
        meta: {
          keep: true
        }
      },
      {
        path: '/eng/phrase',
        component: () => import('./page/english/phrase.vue'),
        name: 'eng.phrase',
        meta: {
          keep: true
        }
      },
      {
        path: '/eng/reading',
        component: () => import('./page/english/reading.vue'),
        name: 'eng.reading',
        meta: {
          keep: true
        }
      },
      {
        path: '/eng/freedom',
        component: () => import('./page/english/freedom.vue'),
        name: 'eng.freedom',
        meta: {
          keep: true
        }
      },
      {
        path: '/eng/listen',
        component: () => import('./page/english/listen.vue'),
        name: 'eng.listen',
        meta: {
          keep: true
        }
      },
    ]
  },
  {
    path: '/pinyin',
    component: () => import('./page/pinyin/index.vue'),
    name: 'pinyin.',
    children: [
      {
        path: '/pinyin/yingbiao',
        component: () => import('./page/pinyin/yingbiao.vue'),
        name: 'pinyin.yingbiao',
        meta: {
          keep: true
        }
      },
      {
        path: '/pinyin/word',
        component: () => import('./page/pinyin/word.vue'),
        name: 'pinyin.word',
        meta: {
          keep: true
        }
      },
    ]
  }
];

export const router = createRouter({
  history: createWebHashHistory(),
  routes
});